using System;
using UnityEngine;

[Serializable]
public class selectplay : MonoBehaviour
{
	public AudioClip clip;

	public Texture pressed;

	public Texture unpressed;

	public string loadscene;

	public GameObject currentarena;

	public GameObject other1;

	public GameObject other2;

	public GameObject other3;

	public GameObject other4;

	public GameObject other5;

	public selectplay other11;

	public selectplay other22;

	public selectplay other33;

	public selectplay other44;

	public selectplay other55;

	public GUITexture gui;

	public loadarenastadium loader;

	public int originalinset;

	public int state;

	public selectplay()
	{
		loadscene = "arena1";
		originalinset = -265;
		state = 1;
	}

	public void Start()
	{
		originalinset = (int)gui.pixelInset.x;
	}

	public void Update()
	{
		if (UnityEngine.Input.touchCount <= 0)
		{
			return;
		}
		Touch touch = Input.touches[0];
		if (touch.phase == TouchPhase.Began && GetComponent<GUITexture>().HitTest(touch.position))
		{
			AudioSource.PlayClipAtPoint(clip, Camera.main.transform.position);
			gui.texture = pressed;
			if (state == 1)
			{
				float num = GetComponent<GUITexture>().pixelInset.x + 20f;
				Rect pixelInset = gameObject.GetComponent<GUITexture>().pixelInset;
				float num3 = pixelInset.x = num;
				Rect rect2 = gameObject.GetComponent<GUITexture>().pixelInset = pixelInset;
				state = 0;
			}
			loader.arenatoload = loadscene;
			currentarena.SetActiveRecursively(state: true);
			other1.SetActiveRecursively(state: false);
			other2.SetActiveRecursively(state: false);
			other3.SetActiveRecursively(state: false);
			other4.SetActiveRecursively(state: false);
			other5.SetActiveRecursively(state: false);
			other11.change();
			other22.change();
			other33.change();
			other44.change();
			other55.change();
		}
	}

	public void change()
	{
		state = 1;
		int num = originalinset;
		Rect pixelInset = gui.pixelInset;
		float num3 = pixelInset.x = num;
		Rect rect2 = gui.pixelInset = pixelInset;
		gui.texture = unpressed;
	}

	public void Main()
	{
	}
}
